package leetcode.code209;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public abstract class Solution209 implements IDebug {

	public abstract int minSubArrayLen(int target, int[] nums);

	@Override
	public void debug1() {
		// 输入：target = 7, nums = [2,3,1,2,4,3]
		// 输出：2
		int target = 7;
		int expect = 2;
		String s = "[2,3,1,2,4,3]";
		this.debug(target, s, expect);
	}

	private void debug(int target, String s, int expect) {
		int[] nums = HelpDebug.str2array3(s);
		int result = this.minSubArrayLen(target, nums);
		HelpDebug.compare(expect, result);
	}

	@Override
	public void debug2() {
		// 输入：target = 4, nums = [1,4,4]
		// 输出：1
		int target = 4;
		int expect = 1;
		String s = "[1,4,4]";
		this.debug(target, s, expect);
	}

	@Override
	public void debug3() {
		// 输入：target = 11, nums = [1,1,1,1,1,1,1,1]
		// 输出：0
		int target = 11;
		int expect = 0;
		String s = "[1,1,1,1,1,1,1,1]";
		this.debug(target, s, expect);
	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

}
